/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package app;

import control.OperadoraRemote;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import model.ContaPrePago;

/**
 *
 * @author fabio
 */
public class Dadosteste {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        InitialContext ctx;
        try {
            ctx = new InitialContext();
            OperadoraRemote opl =(OperadoraRemote)ctx.lookup("Operadora");
            ContaPrePago c1 = new ContaPrePago("99998888","12345678900");
            ContaPrePago c2 = new ContaPrePago("99999999","98765432100");
            ContaPrePago c3 = new ContaPrePago("88889999","11122233344");
            if(opl.localizarNumero(c1.getNumero(), c1.getCpf()) == null)
                opl.criarConta(c1);
            if(opl.localizarNumero(c2.getNumero(), c2.getCpf()) == null)
                opl.criarConta(c2);
            if(opl.localizarNumero(c3.getNumero(), c3.getCpf()) == null)
                opl.criarConta(c3);            
        } catch (NamingException ex) {
            Logger.getLogger(Dadosteste.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
    }
}
